#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
int n;

struct Range {
	int num, index;
	bool operator< (const Range &W)const {
		return num < W.num;
	}
} range[N];

int main() {
	cin >> n;
	for (int i = 0; i < n; ++i) {
		cin >> range[i].num;
		range[i].index = i + 1;
	}
	sort(range, range + n);
	reverse(range, range + n);
	long long sum = 0;
	for (int i = 0; i < n; ++i) {
		sum += range[i].num * i;
	}
	reverse(range, range + n);
	for (int i = 0; i < n; ++i) {
		cout << range[i].index << ' ';
	}
	cout << endl;
	printf("%.2f", sum * 1.0 / n);
	return 0;
}